package com.hsfw.pmauthzuul.service;



import com.hsfw.dbmodule.entity.UserDetail;
import com.hsfw.dbmodule.entity.UserToken;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by RAZR on 16:17 2019/3/22.
 */
public interface AuthService {
    /**
     * 登陆
     *
     * @param account
     * @param password
     * @return
     */
    UserToken login(String account, String password);
    /**
     * 注册用户
     * @param userDetail
     * @return
     */
    UserDetail register(UserDetail userDetail);
    /**
     * 更新用户信息
     * @param userDetail
     * @return
     */
    UserDetail updateUserInfo(UserDetail userDetail);

    /**
     * 登出
     *
     * @param request
     */
    void logout(HttpServletRequest request);

    /**
     * 刷新Token
     *
     * @param oldToken
     * @return
     */
    UserToken refresh(String oldToken);

    /**
     * 根据Token获取用户信息
     *
     * @param token
     * @return
     */
    UserDetail getUserByToken(String token);
}
